import request from '@/utils/request'


// 查询水电设备类型字典详细
export function dictType() {
  return request({
    url: '/sys/dict/detail/dictType?dictType=weType',
    method: 'get',
  })
}

//分页查询
export function selectPage(query) {
  return request({
    url: '/apartment/weequipment/selectPage',
    method: 'get',
    params: query
  })
}

//操作记录查询
export function getOperatingRecord(query) {
  return request({
    url: '/apartment/weequipment/getOperatingRecord',
    method: 'get',
    params: query
  })
}


// 添加水电设备
export function addWeEquipment(form) {
  return request({
    url: '/apartment/weequipment/addWeEquipment',
    method: 'post',
    data: form
  })
}


// 修改水电设备
export function updateWeEquipment(form) {
  return request({
    url: '/apartment/weequipment/updateWeEquipment',
    method: 'put',
    data: form
  })
}

// 删除水电设备
export function deleteWeEquipment(id) {
  return request({
    url: '/apartment/weequipment/deleteWeEquipment/' + id,
    method: 'delete',
  })
}


// 水表
export function operationWater(id, type) {
  return request({
    url: '/water/instruct/operationWater/' + id + "/" + type,
    method: 'get',
  })
}

// 电闸
export function operationElectricity(id, type) {
  return request({
    url: '/electricity/instruct/operationElectricity/' + id + "/" + type,
    method: 'get',
  })
}

// 电表设备下拉
export function getEList() {
  return request({
    url: '/apartment/weequipment/getEList',
    method: 'get',
  })
}

// 获取单个信息
export function getOne(id) {
  return request({
    url: '/electricity/instruct/' + id,
    method: 'get',
  })
}


